import { useState } from 'react';
import { getData5 } from '../Data'
import { useMount, useReactive } from 'ahooks';
import { FlexGrid } from "@grapecity/wijmo.react.grid";
import { GroupPanel } from "@grapecity/wijmo.react.grid.grouppanel";


const WijmoH02 = () => {

    const InitData = useReactive({
        init: null
    })

    const [Data, setData] = useState()
    useMount(() => { setData(getData5(100)) })


    const init = (init) => {
        InitData.init = init
    }

    if (Data) {
        return (
            <div className="Page">
                <GroupPanel
                    className="group-panel"
                    grid={InitData.init}
                    placeholder="将列拖动到此处以创建组"
                />

                <FlexGrid
                    initialized={init}
                    itemsSource={Data}
                />
            </div>
        )
    }
}

export default WijmoH02